<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>作业1</title>
</head>
<body>
    <div>
           <script>
        var ClassArray = new Array('张三','李四','王五'); 
    </script>
    <script>
        var i;
        for(i=0;i<ClassArray.length;i++){
            document.write(ClassArray[i]+"\t");
        }
        document.write("<br/>");
        ClassArray[3]="赵六";
        document.write("添加后，该数组索引为3的值："+ClassArray[3]+"<br/>");
        ClassArray[0]="张三疯";
        document.write("修改后，该数组索引为0的值："+ClassArray[0]+"<br/>");
    </script>
        <script>
           var str=ClassArray.join();
            document.write(str+"<br/>");
        </script>
        <script>
            ClassArray[3]=null;
            for(i=0;i<ClassArray.length;i++){
            document.write(ClassArray[i]+"\t");
        }
        </script>
        <p id="out"></p>
        <script>
            var arr =new Array(10);
            var i=0;
            function getnum(){     
                for(i=0;i<10;i++){
                    var num=Math.floor(Math.random()*100);
                     arr[i]=num;  
                }        
                     
                document.getElementById('out').innerHTML=arr;
            }
            
        </script>
        <button onclick="getnum()">生成随机数</button>
        <script>
            window.onload=function(){ 
            changeColor();
        }   
            function changeColor(){
            var r=Math.floor(Math.random()*255);
            var g=Math.floor(Math.random()*255);
            var b=Math.floor(Math.random()*255);
            var rgb=r.toString(16)+g.toString(16)+b.toString(16); 
            document.body.bgColor="#"+rgb;
            window.setTimeout("changeColor()",1000);
            }
           	document.body.style.backgroundColor = changeColor();
        </script>
    </div>
 

</body>
</html>